<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>2.46</title>
</head>

<body>
    <script>
        //test.html文件
        import * as constants from './constants.js';
        console.log(constants.A);   //1
        console.log(constants.B);   //3

            //test2.html文件
            // import {A,B} from './constants.js';
            // console.log(A); //1
            // console.log(B); //3
    </script>
</body>

</html>